| java.lang.Object com.sun.kvem.jsr082.bluetooth.BluetoothConnection
All known Subclasses: com.sun.midp.io.j2me.btl2cap.L2CAPConnectionImpl, com.sun.midp.io.j2me.btspp.BTSPPConnectionImpl,
BluetoothConnection | abstract public class BluetoothConnection (Code) | | Base class for all bluetooth connections.
|
Field Summary | |
protected int | mode Keeps open mode. | protected BluetoothUrl | url Keeps requested connection details. |
Method Summary | |
public boolean | authorize() Authorizes this connection. | protected void | checkOpen() Checks if this connection is open. | protected void | checkReadMode() Checks read access. | protected void | checkSecurity() Performs security checks, such as authentication, authorization, and
encryption setup. | protected void | checkWriteMode() Checks write access. | public boolean | encrypt(boolean enable) Changes encryption for this connection. | public static BluetoothConnection | getConnection(Connection conn) Retrieves BluetoothConnection from given one.
Connection given is supposed to be either Bluetooth connection
or a connection that uses Bluetooth as transport. | public RemoteDevice | getRemoteDevice() Returns remote device for this connection. | abstract public String | getRemoteDeviceAddress() Returns Bluetooth address of the remote device for this connection. | protected int | getServiceRecordHandle() Returns handle for the service record of the service this connection
is attached to. | public boolean | isAuthorized() Returns the authorization state of this connection. | public boolean | isClosed() Determines if this connection is closed. | public boolean | isServerSide() Determines whether this connection represents the server side,
i.e. | protected void | resetRemoteDevice() Removes reference to the remote device. | protected void | setRemoteDevice() Retrieves reference to the remote device for this connection. |
mode | protected int mode(Code) | | Keeps open mode.
|
BluetoothConnection | protected BluetoothConnection(BluetoothUrl url, int mode)(Code) | | Creates a new instance of this class.
Parameters: url - connection url Parameters: mode - I/O access mode server side otherwise it's false |
authorize | public boolean authorize()(Code) | | Authorizes this connection. It is assumed that the remote device has
previously been authenticated. This connection must represent the server
side, i.e. isServer() should return true.
true if the operation succeeded, false otherwise |
checkOpen | protected void checkOpen() throws IOException(Code) | | Checks if this connection is open.
throws: IOException - if this connection is closed |
checkReadMode | protected void checkReadMode() throws IOException(Code) | | Checks read access.
throws: IOException - if open mode does not permit read access |
checkWriteMode | protected void checkWriteMode() throws IOException(Code) | | Checks write access.
throws: IOException - if open mode does not permit write access |
encrypt | public boolean encrypt(boolean enable)(Code) | | Changes encryption for this connection.
Parameters: enable - specifies whether encription should be turned on or off true if encryption has been set as required, false otherwise |
getConnection | public static BluetoothConnection getConnection(Connection conn) throws IOException(Code) | | Retrieves BluetoothConnection from given one.
Connection given is supposed to be either Bluetooth connection
or a connection that uses Bluetooth as transport. All involved
connections supposed to be open.
Parameters: conn - the connection to extract Bluetooth connection from proper BluetoothConnection instance throws: IllegalArgumentException - if connection is neither an instanceof BluetoothConnection, nor uses one as transport. throws: IOException - if connection given or transport is closed ortransport is invalid. |
getRemoteDevice | public RemoteDevice getRemoteDevice() throws IOException(Code) | | Returns remote device for this connection.
RemoteDevice object for this connection throws: IOException - if this connection is closed |
getRemoteDeviceAddress | abstract public String getRemoteDeviceAddress()(Code) | | Returns Bluetooth address of the remote device for this connection.
Bluetooth address of the remote device |
getServiceRecordHandle | protected int getServiceRecordHandle()(Code) | | Returns handle for the service record of the service this connection
is attached to. Valid for server-side (incoming) connections only.
service record handle, or 0 if the handle is not available |
isAuthorized | public boolean isAuthorized()(Code) | | Returns the authorization state of this connection.
true if this connection has been authorized, false otherwise |
isClosed | public boolean isClosed()(Code) | | Determines if this connection is closed.
true if this connection is closed, false otherwise |
isServerSide | public boolean isServerSide()(Code) | | Determines whether this connection represents the server side,
i.e. this connection was created by a notifier in acceptAndOpen().
true if this connection is a server-side connection,false otherwise |
resetRemoteDevice | protected void resetRemoteDevice()(Code) | | Removes reference to the remote device.
|
setRemoteDevice | protected void setRemoteDevice()(Code) | | Retrieves reference to the remote device for this connection.
|
|
|