|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.avetana.bluetooth.connection.ConnectionFactory
The class used to manage connections at the application level.
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:
One of the request of the JSR82 specification is to be able to test if a device is connected or not.
For example the method javax.bluetooth.RemoteDevice.authenticate() must throw an exception if it is called
for a remote device which is not connected with any local device. There is two ways of handling such a
request:
| Constructor Summary | |
ConnectionFactory()
Creates a new ConnectionFactory object. |
|
| Method Summary | |
void |
addConnection(BTConnection desc)
Adds a connection to the list of registered connections |
void |
addListener(int transactionID,
DiscoveryListener list)
Registers a new DiscoveryListener. |
void |
addNotifier(ConnectionNotifier desc)
Registers a new connection notifier |
BTConnection |
getConnectionForFID(int fid)
Returns the connection for a given fid |
java.util.Vector |
getConnections()
Returns the list of all registered connections. |
DiscoveryListener |
getListener(int id)
Returns the DiscoveryListener associated with a remote device |
java.util.Vector |
getNotifiers()
Returns the list of all registered notifiers. |
BTConnection |
isConnected(RemoteDevice dev)
Tells if a remote device is currently connected with a local device |
boolean |
isListener(int transID)
|
boolean |
removeConnection(BTConnection desc)
Unregisters a Connection |
boolean |
removeConnection(int fid)
Unregisters the Connection identified by its connection ID |
void |
removeListener(int transID)
|
boolean |
removeNotifier(ConnectionNotifier desc)
Unregisters a Connection notifier |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ConnectionFactory()
| Method Detail |
public void addConnection(BTConnection desc)
desc - The unregistered connectionpublic java.util.Vector getConnections()
public BTConnection getConnectionForFID(int fid)
fid -
public java.util.Vector getNotifiers()
public boolean removeConnection(BTConnection desc)
desc - The registered connection
true - if the connection was successfully unregisteredfalse - Otherwise.public void addNotifier(ConnectionNotifier desc)
desc - A new and unregistered connection notifierpublic boolean removeNotifier(ConnectionNotifier desc)
desc - The registered connection notifier
true - if the connection notifier was successfully unregisteredfalse - Otherwise.public boolean removeConnection(int fid)
fid - The ID of the registered connection
true - if the connection was successfully unregisteredfalse - Otherwise.
public void addListener(int transactionID,
DiscoveryListener list)
list - The Discoverylistener associated with this remote devicepublic boolean isListener(int transID)
public void removeListener(int transID)
public DiscoveryListener getListener(int id)
public BTConnection isConnected(RemoteDevice dev)
dev - The remote device
The BTConnection object - If the remote device is currently connected
null - If the remote device is not connected.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||