|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.avetana.bluetooth.connection.ConnectionNotifier
The top-level connection notifier class.
COPYRIGHT:
(c) Copyright 2004 Avetana GmbH ALL RIGHTS RESERVED.
This file is part of the Avetana bluetooth API for Linux.
The Avetana bluetooth API for Linux is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The Avetana bluetooth API 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 General Public License for more details.
The development of the Avetana bluetooth API is based on the work of
Christian Lorenz (see the Javabluetooth Stack at http://www.javabluetooth.org) for some classes,
on the work of the jbluez team (see http://jbluez.sourceforge.net/) and
on the work of the bluez team (see the BlueZ linux Stack at http://www.bluez.org) for the C code.
Classes, part of classes, C functions or part of C functions programmed by these teams and/or persons
are explicitly mentioned.
Description:
The top-level class for connection notifiers.
Depending on the protocol, connection notifiers can differently implement the method AcceptAndOpen() but
if only some method implementations differ, the principles of a JSR82 connection notifier remain for each protocol:
a service record, a connection ID, a connection URL and a remote device. This class encapsulates the common properties
of JSR82 notifiers and is therefore the class used in the ConnectionFactory.
| Field Summary | |
protected java.io.IOException |
failEx
When registering of a connection fails, the reason is given here |
protected boolean |
isClosed
Is the connection with the remote device closed? |
protected int |
m_fid
The connection ID |
protected RemoteDevice |
m_remote
The remote device |
protected int |
m_serverFid
When a connection listener is established, its ID is stored as m_serverFid. |
protected long |
m_serviceHandle
The service record handle |
protected BTConnection |
myConnection
The current connection of this notifier |
protected ServiceRecord |
myRecord
The local service record |
protected JSR82URL |
parsedURL
The connection URL used to create the local service |
| Constructor Summary | |
ConnectionNotifier()
|
|
| Method Summary | |
protected void |
acceptAndOpenI()
Waits for a client to connect to this service. |
void |
close()
Closes the connection NOTIFIER (and not the connection itself) . |
JSR82URL |
getConnectionURL()
Returns the connection URL |
RemoteDevice |
getRemoteDevice()
Return the remote connections end |
long |
getServiceHandle()
Returns the service record handle |
ServiceRecord |
getServiceRecord()
Returns the local service record |
boolean |
isNotifierClosed()
Gets the state of the notifier |
boolean |
isServiceRegistered()
Gets the registration state of the local service |
void |
removeNotifier()
Remove the notifier and the SDP Record |
void |
setConnectionID(int fid)
Sets the connection ID |
void |
setFailure(java.io.IOException e)
|
void |
setRemoteDevice(java.lang.String addr)
Sets the remote device |
void |
setServerFID(int fid)
Sets the connection ID |
void |
setServiceRecord(ServiceRecord a_record)
Sets the local service record. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected int m_fid
protected BTConnection myConnection
protected int m_serverFid
protected java.io.IOException failEx
protected long m_serviceHandle
protected ServiceRecord myRecord
protected boolean isClosed
protected JSR82URL parsedURL
protected RemoteDevice m_remote
| Constructor Detail |
public ConnectionNotifier()
| Method Detail |
public void setConnectionID(int fid)
fid - The connection IDpublic void setServerFID(int fid)
fid - The connection IDpublic void setFailure(java.io.IOException e)
public void setRemoteDevice(java.lang.String addr)
addr - The BT address of the remote devicepublic long getServiceHandle()
public JSR82URL getConnectionURL()
public RemoteDevice getRemoteDevice()
public ServiceRecord getServiceRecord()
public boolean isServiceRegistered()
true - If the service is registeredfalse - Otherwisepublic boolean isNotifierClosed()
true - If the notifier is closed
false - Otherwise.
public void setServiceRecord(ServiceRecord a_record)
throws java.lang.Exception
a_record - The new loca lservice record
java.lang.Exception - ClassCastException - If the new local service record is not an instance of LocalServiceRecordpublic void removeNotifier()
public void close()
close in interface Connection
protected void acceptAndOpenI()
throws java.io.IOException,
ServiceRegistrationException
java.io.IOException
ServiceRegistrationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||