/* MIT ICT4DLab SMS Lab framework
 * 
 * Copyright (C) 2008, Massachusetts Institute of Technology
 * 
 * ICT4DLab SMS is distributed under the terms of the Apache License version 2.0
 * 
 * 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.
 * 
 * original author: Luis F. G. Sarmenta ( lfgs @ mit . edu ) 
 * v0.1.0: 20080228
 * 
 * Last modified by:
 * date:
 * comment:
 */

package org.ict4dlab.sms.core;

public abstract class BasicSMSApplication implements SMSApplication {

    private SMSSender smsSender;

    public abstract SMSMessage onSMSMessageReceived(SMSMessage incomingMsg);

    public SMSSender getSMSSender() {
	return smsSender;
    }

    public void setSMSSender(SMSSender smsSender) {
	this.smsSender = smsSender;
    }

    /**
     * Internal convenience method for sending messages.
     * 
     * @param msg
     *                SMSMessage to be sent
     * @return true if successful
     */
    protected boolean sendSMSMessage(SMSMessage outgoingMsg) {
	return this.smsSender.sendSMSMessage(outgoingMsg);
    }

}
