当前位置: 首页>>代码示例>>Java>>正文


Java CancelSm类代码示例

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


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

示例1: cancelSm

import org.jsmpp.bean.CancelSm; //导入依赖的package包/类
public CancelSm cancelSm(byte[] data) throws PDUStringException {
    CancelSm req = new CancelSm();
    SequentialBytesReader reader = new SequentialBytesReader(data);
    assignHeader(req, reader);
    req.setServiceType(reader.readCString());
    StringValidator.validateString(req.getServiceType(),
            StringParameter.SERVICE_TYPE);

    req.setMessageId(reader.readCString());
    StringValidator.validateString(req.getMessageId(),
            StringParameter.MESSAGE_ID);

    req.setSourceAddrTon(reader.readByte());
    req.setSourceAddrNpi(reader.readByte());
    req.setSourceAddr(reader.readCString());
    StringValidator.validateString(req.getSourceAddr(),
            StringParameter.SOURCE_ADDR);

    req.setDestAddrTon(reader.readByte());
    req.setDestAddrNpi(reader.readByte());
    req.setDestinationAddress(reader.readCString());
    StringValidator.validateString(req.getDestinationAddress(),
            StringParameter.DESTINATION_ADDR);

    return req;
}
 
开发者ID:opentelecoms-org,项目名称:jsmpp,代码行数:27,代码来源:DefaultDecomposer.java

示例2: execute

import org.jsmpp.bean.CancelSm; //导入依赖的package包/类
@Override
public void execute(Exchange exchange) throws SmppException {
    CancelSm cancelSm = createCancelSm(exchange);

    if (log.isDebugEnabled()) {
        log.debug("Canceling a short message for exchange id '{}' and message id '{}'",
                exchange.getExchangeId(), cancelSm.getMessageId());
    }

    try {
        session.cancelShortMessage(
                cancelSm.getServiceType(),
                cancelSm.getMessageId(),
                TypeOfNumber.valueOf(cancelSm.getSourceAddrTon()),
                NumberingPlanIndicator.valueOf(cancelSm.getSourceAddrNpi()),
                cancelSm.getSourceAddr(),
                TypeOfNumber.valueOf(cancelSm.getDestAddrTon()),
                NumberingPlanIndicator.valueOf(cancelSm.getDestAddrNpi()),
                cancelSm.getDestinationAddress());
    } catch (Exception e) {
        throw new SmppException(e);
    }

    if (log.isDebugEnabled()) {
        log.debug("Cancel a short message for exchange id '{}' and message id '{}'",
                exchange.getExchangeId(), cancelSm.getMessageId());
    }

    Message message = getResponseMessage(exchange);
    message.setHeader(SmppConstants.ID, cancelSm.getMessageId());
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:32,代码来源:SmppCancelSmCommand.java

示例3: fireAcceptCancelSm

import org.jsmpp.bean.CancelSm; //导入依赖的package包/类
private void fireAcceptCancelSm(CancelSm cancelSm) throws ProcessRequestException {
    if (messageReceiverListener != null) {
        messageReceiverListener.onAcceptCancelSm(cancelSm, this);
    } else {
        logger.warn(MESSAGE_RECEIVER_LISTENER_IS_NULL);
        throw new ProcessRequestException(NO_MESSAGE_RECEIVER_LISTENER_REGISTERED,
                SMPPConstant.STAT_ESME_RX_R_APPN);
    }
}
 
开发者ID:opentelecoms-org,项目名称:jsmpp,代码行数:10,代码来源:SMPPServerSession.java

示例4: processCancelSm

import org.jsmpp.bean.CancelSm; //导入依赖的package包/类
public void processCancelSm(CancelSm cancelSm)
        throws ProcessRequestException {
    try {
        fireAcceptCancelSm(cancelSm);
    } catch(Exception e) {
        String msg = "Invalid runtime exception thrown when processing CancelSm";
        logger.error(msg, e);
        throw new ProcessRequestException(msg, SMPPConstant.STAT_ESME_RSYSERR);
    }
}
 
开发者ID:opentelecoms-org,项目名称:jsmpp,代码行数:11,代码来源:SMPPServerSession.java

示例5: createCancelSm

import org.jsmpp.bean.CancelSm; //导入依赖的package包/类
protected CancelSm createCancelSm(Exchange exchange) {
    Message in = exchange.getIn();
    CancelSm cancelSm = new CancelSm();

    if (in.getHeaders().containsKey(SmppConstants.ID)) {
        cancelSm.setMessageId(in.getHeader(SmppConstants.ID, String.class));
    }

    if (in.getHeaders().containsKey(SmppConstants.SOURCE_ADDR)) {
        cancelSm.setSourceAddr(in.getHeader(SmppConstants.SOURCE_ADDR, String.class));
    } else {
        cancelSm.setSourceAddr(config.getSourceAddr());
    }

    if (in.getHeaders().containsKey(SmppConstants.SOURCE_ADDR_TON)) {
        cancelSm.setSourceAddrTon(in.getHeader(SmppConstants.SOURCE_ADDR_TON, Byte.class));
    } else {
        cancelSm.setSourceAddrTon(config.getSourceAddrTon());
    }

    if (in.getHeaders().containsKey(SmppConstants.SOURCE_ADDR_NPI)) {
        cancelSm.setSourceAddrNpi(in.getHeader(SmppConstants.SOURCE_ADDR_NPI, Byte.class));
    } else {
        cancelSm.setSourceAddrNpi(config.getSourceAddrNpi());
    }

    if (in.getHeaders().containsKey(SmppConstants.DEST_ADDR)) {
        cancelSm.setDestinationAddress(in.getHeader(SmppConstants.DEST_ADDR, String.class));
    } else {
        cancelSm.setDestinationAddress(config.getDestAddr());
    }

    if (in.getHeaders().containsKey(SmppConstants.DEST_ADDR_TON)) {
        cancelSm.setDestAddrTon(in.getHeader(SmppConstants.DEST_ADDR_TON, Byte.class));
    } else {
        cancelSm.setDestAddrTon(config.getDestAddrTon());
    }

    if (in.getHeaders().containsKey(SmppConstants.DEST_ADDR_NPI)) {
        cancelSm.setDestAddrNpi(in.getHeader(SmppConstants.DEST_ADDR_NPI, Byte.class));
    } else {
        cancelSm.setDestAddrNpi(config.getDestAddrNpi());
    }

    if (in.getHeaders().containsKey(SmppConstants.SERVICE_TYPE)) {
        cancelSm.setServiceType(in.getHeader(SmppConstants.SERVICE_TYPE, String.class));
    } else {
        cancelSm.setServiceType(config.getServiceType());
    }

    return cancelSm;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:53,代码来源:SmppCancelSmCommand.java

示例6: onAcceptCancelSm

import org.jsmpp.bean.CancelSm; //导入依赖的package包/类
void onAcceptCancelSm(CancelSm cancelSm, SMPPServerSession source)
throws ProcessRequestException;
 
开发者ID:opentelecoms-org,项目名称:jsmpp,代码行数:3,代码来源:ServerMessageReceiverListener.java

示例7: processCancelSm

import org.jsmpp.bean.CancelSm; //导入依赖的package包/类
public void processCancelSm(CancelSm cancelSm)
        throws ProcessRequestException {
}
 
开发者ID:opentelecoms-org,项目名称:jsmpp,代码行数:4,代码来源:DummyResponseHandler.java

示例8: onAcceptCancelSm

import org.jsmpp.bean.CancelSm; //导入依赖的package包/类
public void onAcceptCancelSm(CancelSm cancelSm, SMPPServerSession source)
        throws ProcessRequestException {
    LOGGER.info("Accepting CancelSm, but not implemented");
    throw new ProcessRequestException(CANCELSM_NOT_IMPLEMENTED, SMPPConstant.STAT_ESME_RCANCELFAIL);
}
 
开发者ID:opentelecoms-org,项目名称:jsmpp,代码行数:6,代码来源:SMPPServerSimulator.java

示例9: onAcceptCancelSm

import org.jsmpp.bean.CancelSm; //导入依赖的package包/类
public void onAcceptCancelSm(CancelSm cancelSm, SMPPServerSession source)
        throws ProcessRequestException {
    LOGGER.warn("CancelSm not implemented");
    throw new ProcessRequestException(CANCELSM_NOT_IMPLEMENTED, SMPPConstant.STAT_ESME_RCANCELFAIL);
}
 
开发者ID:opentelecoms-org,项目名称:jsmpp,代码行数:6,代码来源:StressServer.java

示例10: onAcceptCancelSm

import org.jsmpp.bean.CancelSm; //导入依赖的package包/类
@Override
public void onAcceptCancelSm(CancelSm cancelSm, SMPPServerSession source) throws ProcessRequestException {
	// nothing to do
}
 
开发者ID:groupe-sii,项目名称:ogham,代码行数:5,代码来源:JSMPPServerSimulator.java

示例11: cancelSm

import org.jsmpp.bean.CancelSm; //导入依赖的package包/类
/**
 * Decompose the SMPP PDU cancel short message command.
 * 
 * @param data is the PDU.
 * @return the cancel short message command object.
 * @throws PDUStringException if there is an invalid constraint of string
 *         parameter found.
 */
CancelSm cancelSm(byte[] data) throws PDUStringException;
 
开发者ID:opentelecoms-org,项目名称:jsmpp,代码行数:10,代码来源:PDUDecomposer.java

示例12: processCancelSm

import org.jsmpp.bean.CancelSm; //导入依赖的package包/类
void processCancelSm(CancelSm cancelSm) throws ProcessRequestException; 
开发者ID:opentelecoms-org,项目名称:jsmpp,代码行数:2,代码来源:ServerResponseHandler.java


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