| java.lang.Object com.sun.midp.io.BluetoothProtocol
All known Subclasses: com.sun.midp.io.j2me.btl2cap.Protocol, com.sun.midp.io.j2me.btspp.Protocol, com.sun.midp.io.j2me.btgoep.Protocol,
BluetoothProtocol | abstract public class BluetoothProtocol implements ConnectionBaseInterface(Code) | | Provides abstract base for bluetooth protocols.
|
Field Summary | |
protected BluetoothUrl | url Keeps set of fields specified by URL. |
Constructor Summary | |
protected | BluetoothProtocol(int protocol) Constructs an instance. |
Method Summary | |
protected void | checkForPermission(SecurityToken token, int permission) Makes sure caller has the com.sun.midp permission set to "allowed". | protected void | checkUrl(BluetoothUrl url) Ensures URL parameters have valid values. | abstract protected Connection | clientConnection(SecurityToken token, int mode) Ensures that permissions are proper and creates client side connection. | public Connection | openPrim(String name, int mode, boolean timeouts) Implements the openPrim() of
ConnectionBaseInerface and allows to get
connection by means of Connector.open()
call. | public Connection | openPrim(Object token, String name, int mode, boolean timeouts) Checks permissions and opens requested connection.
Parameters: token - security token of the calling class Parameters: name - the URL without protocol name and colon. Parameters: mode - connector.READ_WRITE or connector.READ or connector.WRITE Parameters: timeouts - ignored. | protected Connection | openPrimImpl(Object token, BluetoothUrl url, int mode) Checks permissions and opens requested connection. | abstract protected Connection | serverConnection(SecurityToken token, int mode) Ensures that permissions are proper and creates required notifier at
server side. |
BluetoothProtocol | protected BluetoothProtocol(int protocol)(Code) | | Constructs an instance.
Parameters: protocol - specifies particular protocol, must be one of BluetoothUrl.L2CAP, BluetoothUrl.RFCOMM, BluetoothUrl.OBEX |
checkForPermission | protected void checkForPermission(SecurityToken token, int permission) throws InterruptedIOException(Code) | | Makes sure caller has the com.sun.midp permission set to "allowed".
Parameters: token - security token of the calling class, may be null Parameters: permission - requested permission ID exception: IOInterruptedException - if another thread interrupts thecalling thread while this method is waiting to preempt thedisplay. |
clientConnection | abstract protected Connection clientConnection(SecurityToken token, int mode) throws IOException(Code) | | Ensures that permissions are proper and creates client side connection.
Parameters: token - security token if passed by caller, or null client side connection. Parameters: mode - I/O access mode connection created, defined in subclasses exception: IOException - if opening connection fails. |
openPrim | public Connection openPrim(String name, int mode, boolean timeouts) throws IOException(Code) | | Implements the openPrim() of
ConnectionBaseInerface and allows to get
connection by means of Connector.open()
call.
Parameters: name - the target for the connection Parameters: mode - I/O access mode Parameters: timeouts - ignored L2CAP connection open. exception: IOException - if opening connection fails. |
openPrim | public Connection openPrim(Object token, String name, int mode, boolean timeouts) throws IOException(Code) | | Checks permissions and opens requested connection.
Parameters: token - security token of the calling class Parameters: name - the URL without protocol name and colon. Parameters: mode - connector.READ_WRITE or connector.READ or connector.WRITE Parameters: timeouts - ignored. a notifier in case of server connection string, open connectionin case of client one. exception: IOException - if opening connection fails. |
openPrimImpl | protected Connection openPrimImpl(Object token, BluetoothUrl url, int mode) throws IOException(Code) | | Checks permissions and opens requested connection.
Parameters: token - security token passed by calling class Parameters: url - BluetoothUrl instance that defines requiredconnection stringname the URL without protocol name and colon Parameters: mode - connector.READ_WRITE or connector.READ or connector.WRITE a notifier in case of server connection string, open connectionin case of client one. exception: IOException - if opening connection fails. |
serverConnection | abstract protected Connection serverConnection(SecurityToken token, int mode) throws IOException(Code) | | Ensures that permissions are proper and creates required notifier at
server side.
Parameters: token - security token if passed by caller, or null Parameters: mode - I/O access mode server notifier, defined in subclasses exception: IOException - if opening connection fails. |
|
|