/protocols/smpp/src/main/java/org/mobicents/protocols/smpp/event/SessionObserver.java
http://mobicents.googlecode.com/ · Java · 69 lines · 7 code · 5 blank · 57 comment · 0 complexity · 4665b6bddea26bc2448c49451ab1b8b3 MD5 · raw file
- /*
- * JBoss, Home of Professional Open Source
- * Copyright 2011, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
- package org.mobicents.protocols.smpp.event;
- import org.mobicents.protocols.smpp.Session;
- import org.mobicents.protocols.smpp.message.SMPPPacket;
- /**
- * A connection observer implementation is used to receive event updates from an
- * Connection object. If an application wishes to use asynchronous
- * communications mode with the API framework, it will need to provide an
- * implementation of this interface to the Connection to be notified of SMPP
- * events (such as packet reception).
- *
- * @version $Id: SessionObserver.java 452 2009-01-15 16:56:36Z orank $
- * @see Session#addObserver
- */
- public interface SessionObserver {
- /**
- * Called when a new SMPP packet has been received from the SMSC. This
- * method is called by the API framework whenever an SMPP packet has been
- * read and decoded from the network connection to the SMSC. Identification
- * of the packet type can be achieved by calling
- * {@link SMPPPacket#getCommandId}.
- *
- * @param source
- * the Connection which received the packet.
- * @param packet
- * the SMPP packet received.
- */
- void packetReceived(Session source, SMPPPacket packet);
- /**
- * Called for all events <b>other </b> than packet reception. This method is
- * called for all events generated by the API framework <i>except </i> that
- * of a packet received. The {@link #packetReceived}method is called in
- * that case. The <code>update</code> method is mostly used for control
- * events, such as signifying the exit of the receiver thread or notifying
- * of error conditions.
- *
- * @param source
- * the Connection which received the packet.
- * @param event
- * the SMPP event type.
- * @see com.adenki.smpp.event.SMPPEvent#getType
- */
- void update(Session source, SMPPEvent event);
- }