當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。