/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.jsmpp.session; import java.io.IOException; import org.jsmpp.InvalidResponseException; import org.jsmpp.PDUException; import org.jsmpp.PDUStringException; import org.jsmpp.bean.DataCoding; import org.jsmpp.bean.ESMClass; import org.jsmpp.bean.NumberingPlanIndicator; import org.jsmpp.bean.OptionalParameter; import org.jsmpp.bean.RegisteredDelivery; import org.jsmpp.bean.TypeOfNumber; import org.jsmpp.extra.NegativeResponseException; import org.jsmpp.extra.ResponseTimeoutException; /** * This interface provides all operation that the server session can do. It * doesn't distinct the operation of specific session type (Transmitter, * Receiver) it's just like Transceiver. The distinction might should be * recognized in a different way, such as by user code when they are accepting * bind request or by throwing exception when invoking illegal operation. * * @author uudashr * */ public interface ServerSession { /** * Submit a short message to specified destination address (ESME). This method will * blocks until response received or timeout reached. This method simplify * operations of sending DELIVER_SM command and receiving the DELIVER_SM_RESP. * * @param serviceType is the service_type. * @param sourceAddrTon is the source_addr_ton. * @param sourceAddrNpi is the source_addr_npi. * @param sourceAddr is the source_addr. * @param destAddrTon is the dest_addr_ton. * @param destAddrNpi is the dest_addr_npi. * @param destinationAddr is the destination_addr. * @param esmClass is the esm_class. * @param protocoId is the protocol_id. * @param priorityFlag is the priority_flag. * @param registeredDelivery is the registered_delivery. * @param dataCoding is the data_coding. * @param shortMessage is the short_message. * @param optionalParameters is the optional parameters. * @throws PDUException if there is invalid PDU parameter found. * @throws ResponseTimeoutException if timeout has been reach. * @throws InvalidResponseException if response is invalid. * @throws NegativeResponseException if negative response received. * @throws IOException if there is an I/O error found. */ void deliverShortMessage(String serviceType, TypeOfNumber sourceAddrTon, NumberingPlanIndicator sourceAddrNpi, String sourceAddr, TypeOfNumber destAddrTon, NumberingPlanIndicator destAddrNpi, String destinationAddr, ESMClass esmClass, byte protocoId, byte priorityFlag, RegisteredDelivery registeredDelivery, DataCoding dataCoding, byte[] shortMessage, OptionalParameter... optionalParameters) throws PDUException, ResponseTimeoutException, InvalidResponseException, NegativeResponseException, IOException; /** * Send alert notification to ESME in order to notify the particular mobile * subscriber has become available. * * @param sequenceNumber is the sequence_number. * @param sourceAddrTon is the source_addr_ton. * @param sourceAddrNpi is the source_addr_npi. * @param sourceAddr is the source_addr. * @param esmeAddrTon is the esm_addr_ton. * @param esmeAddrNpi is the esme_addr_npi. * @param esmeAddr is the esme_addr. * @param optionalParameters is the optional parameters. * @throws PDUStringException if there is invalid string found. * @throws ResponseTimeoutException if timeout has been reach. * @throws InvalidResponseException if response is invalid. * @throws NegativeResponseException if negative response received. * @throws IOException if there is an I/O error found. */ void alertNotification(int sequenceNumber, TypeOfNumber sourceAddrTon, NumberingPlanIndicator sourceAddrNpi, String sourceAddr, TypeOfNumber esmeAddrTon, NumberingPlanIndicator esmeAddrNpi, String esmeAddr, OptionalParameter... optionalParameters) throws PDUStringException, ResponseTimeoutException, InvalidResponseException, NegativeResponseException, IOException; }