01: /*
02: * Portions Copyright 2000-2007 Sun Microsystems, Inc. All Rights
03: * Reserved. Use is subject to license terms.
04: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
05: *
06: * This program is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU General Public License version
08: * 2 only, as published by the Free Software Foundation.
09: *
10: * This program is distributed in the hope that it will be useful, but
11: * WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * General Public License version 2 for more details (a copy is
14: * included at /legal/license.txt).
15: *
16: * You should have received a copy of the GNU General Public License
17: * version 2 along with this work; if not, write to the Free Software
18: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
19: * 02110-1301 USA
20: *
21: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
22: * Clara, CA 95054 or visit www.sun.com if you need additional
23: * information or have any questions.
24: */
25:
26: package javax.microedition.sip;
27:
28: import javax.microedition.io.Connection;
29: import java.io.*;
30:
31: /**
32: * This interface defines a SIP server connection notifier.
33: * @see JSR180 spec, v 1.0.1, p 37-39
34: *
35: */
36: public interface SipConnectionNotifier extends Connection {
37:
38: /**
39: * Accepts and opens a new SipServerConnection in this listening point.
40: * If there are no messages in the queue method will block until a
41: * new request is received.
42: * @return SipServerConnection which carries the received request
43: * @throws IOException - if the connection can not be established
44: * @throws InterruptedIOException - if the connection is closed
45: * @throws SipException - TRANSACTION_UNAVAILABLE if the system
46: * can not open new SIP transactions.
47: */
48: public javax.microedition.sip.SipServerConnection acceptAndOpen()
49: throws IOException, SipException;
50:
51: /**
52: * Sets a listener for incoming SIP requests. If a listener is
53: * already set it
54: * will be overwritten. Setting listener to null will remove the current
55: * listener.
56: * @param sscl - listener for incoming SIP requests
57: * @throws IOException - if the connection was closed
58: */
59: public void setListener(
60: javax.microedition.sip.SipServerConnectionListener sscl)
61: throws IOException;
62:
63: /**
64: * Gets the local IP address for this SIP connection.
65: * @return local IP address. Returns null if the address is not available.
66: * @throws IOException - if the connection was closed
67: */
68: public java.lang.String getLocalAddress() throws IOException;
69:
70: /**
71: * Gets the local port for this SIP connection.
72: * @return local port number, that the notifier is listening to.
73: * Returns 0 if the port is not available.
74: * @throws IOException - if the connection was closed
75: */
76: public int getLocalPort() throws IOException;
77: }
|