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

Java BindParameter类代码示例

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

本文整理汇总了Java中org.jsmpp.session.BindParameter的典型用法代码示例。如果您正苦于以下问题:Java BindParameter类的具体用法?Java BindParameter怎么用?Java BindParameter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BindParameter类属于org.jsmpp.session包,在下文中一共展示了BindParameter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createSession

import org.jsmpp.session.BindParameter; //导入依赖的package包/类
private SMPPSession createSession() throws IOException {
    LOG.debug("Connecting to: " + getEndpoint().getConnectionString() + "...");
    
    SMPPSession session = createSMPPSession();
    session.setEnquireLinkTimer(this.configuration.getEnquireLinkTimer());
    session.setTransactionTimer(this.configuration.getTransactionTimer());
    session.addSessionStateListener(internalSessionStateListener);
    session.connectAndBind(
            this.configuration.getHost(),
            this.configuration.getPort(),
            new BindParameter(
                    BindType.BIND_TX,
                    this.configuration.getSystemId(),
                    this.configuration.getPassword(), 
                    this.configuration.getSystemType(),
                    TypeOfNumber.valueOf(configuration.getTypeOfNumber()),
                    NumberingPlanIndicator.valueOf(configuration.getNumberingPlanIndicator()),
                    ""));
    
    LOG.info("Connected to: " + getEndpoint().getConnectionString());
    
    return session;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:24,代码来源:SmppProducer.java


示例2: doStartExpectations

import org.jsmpp.session.BindParameter; //导入依赖的package包/类
private void doStartExpectations() throws IOException {
    expect(endpoint.getConnectionString())
        .andReturn("smpp://[email protected]:2775")
        .times(2);
    session.setEnquireLinkTimer(5000); //expectation
    session.setTransactionTimer(10000); //expectation
    session.addSessionStateListener(isA(SessionStateListener.class));
    expect(session.connectAndBind(
        "localhost",
        new Integer(2775),
        new BindParameter(
                BindType.BIND_TX,
                "smppclient",
                "password",
                "cp",
                TypeOfNumber.UNKNOWN,
                NumberingPlanIndicator.UNKNOWN,
                ""))).andReturn("1");
    expect(endpoint.getConnectionString())
        .andReturn("smpp://[email protected]:2775");
    expect(endpoint.isSingleton()).andReturn(true);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:23,代码来源:SmppProducerTest.java


示例3: addressRangeFromConfigurationIsUsed

import org.jsmpp.session.BindParameter; //导入依赖的package包/类
@Test
public void addressRangeFromConfigurationIsUsed() throws Exception {
    resetToNice(endpoint, session);

    configuration.setAddressRange("(111*|222*|333*)");

    expect(session.connectAndBind(
            "localhost",
            new Integer(2775),
            new BindParameter(
                    BindType.BIND_RX,
                    "smppclient",
                    "password",
                    "cp",
                    TypeOfNumber.UNKNOWN,
                    NumberingPlanIndicator.UNKNOWN,
                    "(111*|222*|333*)"))).andReturn("1");

    replay(endpoint, processor, session);

    consumer.doStart();

    verify(endpoint, processor, session);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:25,代码来源:SmppConsumerTest.java


示例4: main

import org.jsmpp.session.BindParameter; //导入依赖的package包/类
public static void main(String[] args) {
    SMPPSession session = new SMPPSession();
    try {
        session.connectAndBind("localhost", 8056, new BindParameter(BindType.BIND_TX, "test", "test", "cp", TypeOfNumber.UNKNOWN, NumberingPlanIndicator.UNKNOWN, null));

        Random random = new Random();

        final int totalSegments = 3;
        OptionalParameter sarMsgRefNum = OptionalParameters.newSarMsgRefNum((short)random.nextInt());
        OptionalParameter sarTotalSegments = OptionalParameters.newSarTotalSegments(totalSegments);

        for (int i = 0; i < totalSegments; i++) {
            final int seqNum = i + 1;
            String message = "Message part " + seqNum + " of " + totalSegments + " ";
            OptionalParameter sarSegmentSeqnum = OptionalParameters.newSarSegmentSeqnum(seqNum);
            String messageId = submitMessage(session, message, sarMsgRefNum, sarSegmentSeqnum, sarTotalSegments);
            LOGGER.info("Message submitted, message_id is {}", messageId);
        }

        session.unbindAndClose();

    } catch (IOException e) {
        LOGGER.error("Failed connect and bind to host", e);
    }
}
 
开发者ID:opentelecoms-org,项目名称:jsmpp,代码行数:26,代码来源:SubmitLongMessageExample.java


示例5: create

import org.jsmpp.session.BindParameter; //导入依赖的package包/类
@Override
public SMPPSession create() throws Exception
{
    // SMSC connection settings
    final String host = JiveGlobals.getProperty( "sms.smpp.host", "localhost" );
    final int port = JiveGlobals.getIntProperty( "sms.smpp.port", 2775 );
    final String systemId = JiveGlobals.getProperty( "sms.smpp.systemId" );
    final String password = JiveGlobals.getProperty( "sms.smpp.password" );
    final String systemType = JiveGlobals.getProperty( "sms.smpp.systemType" );

    // Settings that apply to 'receiving' SMS. Should not apply to this implementation, as we're not receiving anything..
    final TypeOfNumber receiveTon = JiveGlobals.getEnumProperty( "sms.smpp.receive.ton", TypeOfNumber.class, TypeOfNumber.UNKNOWN );
    final NumberingPlanIndicator receiveNpi = JiveGlobals.getEnumProperty( "sms.smpp.receive.npi", NumberingPlanIndicator.class, NumberingPlanIndicator.UNKNOWN );

    Log.debug( "Creating a new sesssion (host: '{}', port: '{}', systemId: '{}'.", host, port, systemId );
    final SMPPSession session = new SMPPSession();
    session.connectAndBind( host, port, new BindParameter( BindType.BIND_TX, systemId, password, systemType, receiveTon, receiveNpi, null ) );
    Log.debug( "Created a new session with ID '{}'.", session.getSessionId() );
    return session;
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:21,代码来源:SmsService.java


示例6: start

import org.jsmpp.session.BindParameter; //导入依赖的package包/类
public void start() {
    inSession = new SMPPSession();
    try {
        inSession.connectAndBind(smppTransportInDetails.getHost(), smppTransportInDetails.getPort(), new BindParameter(BindType.BIND_RX, smppTransportInDetails.getSystemId(),
                    smppTransportInDetails.getPassword(), smppTransportInDetails.getSystemType() , TypeOfNumber.UNKNOWN, NumberingPlanIndicator.UNKNOWN, null));

        SMPPListener listener = new SMPPListener(smsInManeger);
        inSession.setMessageReceiverListener(listener);
        stop = false;
        System.out.println(" [Axis2] bind and connect to " + smppTransportInDetails.getHost()+" : " +
                smppTransportInDetails.getPort() + " on SMPP Transport");

    } catch (IOException e) {
        log.error("Unable to conncet" + e);
    }

}
 
开发者ID:wso2,项目名称:wso2-axis2-transports,代码行数:18,代码来源:SMPPImplManager.java


示例7: startGateway

import org.jsmpp.session.BindParameter; //导入依赖的package包/类
@Override
public void startGateway() throws TimeoutException, GatewayException, IOException, InterruptedException
{
	if (!session.getSessionState().isBound())
	{
		if (enquireLink > 0)
		{
			session.setEnquireLinkTimer(enquireLink);
		}
		session.connectAndBind(host, port, new BindParameter(bindType, bindAttributes.getSystemId(), bindAttributes.getPassword(), bindAttributes.getSystemType(), bindTypeOfNumber, bindNumberingPlanIndicator, null));
	}
	else
	{
		Logger.getInstance().logWarn("SMPP session already bound.", null, getGatewayId());
		//	throw new GatewayException("Session already bound");
	}
}
 
开发者ID:tdelenikas,项目名称:smslib-v3,代码行数:18,代码来源:JSMPPGateway.java


示例8: startGateway

import org.jsmpp.session.BindParameter; //导入依赖的package包/类
@Override
public void startGateway() throws TimeoutException, GatewayException,
		IOException, InterruptedException {
	
	if(!session.getSessionState().isBound()){
		if(enquireLink>0){
			session.setEnquireLinkTimer(enquireLink);
		}
		
	session.connectAndBind(host, port, new BindParameter(bindType, bindAttributes.getSystemId(), bindAttributes.getPassword(), bindAttributes.getSystemType(), bindTypeOfNumber, bindNumberingPlanIndicator, null));
	
	  
	}else{
		Logger.getInstance().logWarn("SMPP session already bound.", null, getGatewayId());
	//	throw new GatewayException("Session already bound");
	}
	
}
 
开发者ID:pioryan,项目名称:smslib,代码行数:19,代码来源:JSMPPGateway.java


示例9: createSession

import org.jsmpp.session.BindParameter; //导入依赖的package包/类
private SMPPSession createSession() throws IOException {
    SMPPSession session = createSMPPSession();
    session.setEnquireLinkTimer(configuration.getEnquireLinkTimer());
    session.setTransactionTimer(configuration.getTransactionTimer());
    session.addSessionStateListener(internalSessionStateListener);
    session.setMessageReceiverListener(messageReceiverListener);
    session.connectAndBind(this.configuration.getHost(), this.configuration.getPort(),
            new BindParameter(BindType.BIND_RX, this.configuration.getSystemId(),
                    this.configuration.getPassword(), this.configuration.getSystemType(),
                    TypeOfNumber.UNKNOWN, NumberingPlanIndicator.UNKNOWN,
                              configuration.getAddressRange()));

    return session;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:15,代码来源:SmppConsumer.java


示例10: processShouldCreateTheSmppSession

import org.jsmpp.session.BindParameter; //导入依赖的package包/类
@Test
public void processShouldCreateTheSmppSession() throws Exception {
    expect(endpoint.getConnectionString())
        .andReturn("smpp://[email protected]:2775")
        .times(2);
    session.setEnquireLinkTimer(5000); //expectation
    session.setTransactionTimer(10000); //expectation
    session.addSessionStateListener(isA(SessionStateListener.class));
    expect(session.connectAndBind(
        "localhost",
        new Integer(2775),
        new BindParameter(
                BindType.BIND_TX,
                "smppclient",
                "password",
                "cp",
                TypeOfNumber.UNKNOWN,
                NumberingPlanIndicator.UNKNOWN,
                ""))).andReturn("1");
    expect(endpoint.getConnectionString()).andReturn("smpp://[email protected]:2775");
    expect(endpoint.isSingleton()).andReturn(true);
    SmppBinding binding = createMock(SmppBinding.class);
    Exchange exchange = createMock(Exchange.class);
    Message in = createMock(Message.class);
    SmppCommand command = createMock(SmppCommand.class);
    expect(endpoint.getBinding()).andReturn(binding);
    expect(binding.createSmppCommand(session, exchange)).andReturn(command);
    expect(exchange.getIn()).andReturn(in);
    expect(in.getHeader("CamelSmppSystemId", String.class)).andReturn(null);
    expect(in.getHeader("CamelSmppPassword", String.class)).andReturn(null);
    command.execute(exchange);
    
    replay(session, endpoint, binding, exchange, in, command);
    
    producer.doStart();
    producer.process(exchange);
    
    verify(session, endpoint, binding, exchange, in, command);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:40,代码来源:SmppProducerLazySessionCreationTest.java


示例11: processShouldCreateTheSmppSessionWithTheSystemIdAndPasswordFromTheExchange

import org.jsmpp.session.BindParameter; //导入依赖的package包/类
@Test
public void processShouldCreateTheSmppSessionWithTheSystemIdAndPasswordFromTheExchange() throws Exception {
    expect(endpoint.getConnectionString())
        .andReturn("smpp://localhost:2775")
        .times(2);
    session.setEnquireLinkTimer(5000); //expectation
    session.setTransactionTimer(10000); //expectation
    session.addSessionStateListener(isA(SessionStateListener.class));
    expect(session.connectAndBind(
        "localhost",
        new Integer(2775),
        new BindParameter(
                BindType.BIND_TX,
                "smppclient2",
                "password2",
                "cp",
                TypeOfNumber.UNKNOWN,
                NumberingPlanIndicator.UNKNOWN,
                ""))).andReturn("1");
    expect(endpoint.getConnectionString()).andReturn("smpp://localhost:2775");
    SmppBinding binding = createMock(SmppBinding.class);
    Exchange exchange = createMock(Exchange.class);
    Message in = createMock(Message.class);
    SmppCommand command = createMock(SmppCommand.class);
    expect(endpoint.getBinding()).andReturn(binding);
    expect(endpoint.isSingleton()).andReturn(true);
    expect(binding.createSmppCommand(session, exchange)).andReturn(command);
    expect(exchange.getIn()).andReturn(in);
    expect(in.getHeader("CamelSmppSystemId", String.class)).andReturn("smppclient2");
    expect(in.getHeader("CamelSmppPassword", String.class)).andReturn("password2");
    command.execute(exchange);
    
    replay(session, endpoint, binding, exchange, in, command);
    
    producer.doStart();
    producer.process(exchange);
    
    verify(session, endpoint, binding, exchange, in, command);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:40,代码来源:SmppProducerLazySessionCreationTest.java


示例12: doStartShouldStartANewSmppSession

import org.jsmpp.session.BindParameter; //导入依赖的package包/类
@Test
public void doStartShouldStartANewSmppSession() throws Exception {
    resetToNice(endpoint, session);
    expect(endpoint.getConnectionString())
        .andReturn("smpp://[email protected]:2775")
        .times(2);
    session.setEnquireLinkTimer(5000); //expectation
    session.setTransactionTimer(10000); //expectation
    session.addSessionStateListener(isA(SessionStateListener.class));
    session.setMessageReceiverListener(isA(MessageReceiverListener.class)); //expectation
    expect(session.connectAndBind(
            "localhost",
            new Integer(2775),
            new BindParameter(
                    BindType.BIND_RX,
                    "smppclient",
                    "password",
                    "cp",
                    TypeOfNumber.UNKNOWN,
                    NumberingPlanIndicator.UNKNOWN,
                    ""))).andReturn("1");
    expect(endpoint.getConnectionString()).andReturn("smpp://[email protected]:2775");
 
    
    replay(endpoint, processor, session);
    
    
    consumer.doStart();
    
    verify(endpoint, processor, session);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:32,代码来源:SmppConsumerTest.java


示例13: AutoReconnectGateway

import org.jsmpp.session.BindParameter; //导入依赖的package包/类
/**
 * Construct auto reconnect gateway with specified IP address, port and SMPP Bind parameters.
 *
 * @param remoteIpAddress is the SMSC IP address.
 * @param remotePort      is the SMSC port.
 * @param bindParam       is the SMPP Bind parameters.
 */
public AutoReconnectGateway(String remoteIpAddress, int remotePort,
                            BindParameter bindParam) throws IOException {
  this.remoteIpAddress = remoteIpAddress;
  this.remotePort = remotePort;
  this.bindParam = bindParam;
  session = newSession();
}
 
开发者ID:opentelecoms-org,项目名称:jsmpp,代码行数:15,代码来源:AutoReconnectGateway.java


示例14: main

import org.jsmpp.session.BindParameter; //导入依赖的package包/类
public static void main(String[] args) throws IOException {
  Gateway gateway = new AutoReconnectGateway("localhost", 8056,
      new BindParameter(BindType.BIND_TRX, "sms", "sms", "sms",
          TypeOfNumber.UNKNOWN, NumberingPlanIndicator.ISDN, "8080"));
  while (true) {
    try {
      Thread.sleep(1000);
    }
    catch (InterruptedException e) {
    }
  }
}
 
开发者ID:opentelecoms-org,项目名称:jsmpp,代码行数:13,代码来源:AutoReconnectGateway.java


示例15: connect

import org.jsmpp.session.BindParameter; //导入依赖的package包/类
public void connect() throws IOException {

        smppSession.connectAndBind(ConfigValues.SMSC_IP, ConfigValues.SMSC_PORT, new BindParameter(BindType.BIND_TRX, ConfigValues.SMSC_USERNAME, ConfigValues.SMSC_PASSWORD, "cp", TypeOfNumber.UNKNOWN, NumberingPlanIndicator.UNKNOWN, null));
    }
 
开发者ID:amalio,项目名称:spring-json-sms-gateway,代码行数:5,代码来源:SMPPSessionBean.java



注:本文中的org.jsmpp.session.BindParameter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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