|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.openuat.authentication.AuthenticationEventSender
org.openuat.util.HostServerBase
org.openuat.util.BluetoothRFCOMMServer
public class BluetoothRFCOMMServer
This class represents an RFCOMM service which responds to incoming authentication requests by delegating any incoming connection to the HostProtocolHandler class. More specifically, for each incoming RFCOMM connection, the HostProtocolHandler.startIncomingAuthenticationThread is invoked with the connected RFCOMM stream connection. Listening is done in a background thread using blocking accept() calls. After constructing a BluetoothRFCOMMServer object for a specific channel, startListening() needs to be called to start accepting incoming connection. Authentication and encryption as well as authorization on Bluetooth level are deactivated.
| Field Summary |
|---|
| Fields inherited from class org.openuat.util.HostServerBase |
|---|
keepConnected, protocolCommandHandlers, protocolTimeoutMs, running, useJSSE |
| Fields inherited from class org.openuat.authentication.AuthenticationEventSender |
|---|
eventsHandlers |
| Constructor Summary | |
|---|---|
BluetoothRFCOMMServer(java.lang.Integer channel,
javax.bluetooth.UUID serviceUUID,
java.lang.String serviceName,
int protocolTimeoutMs,
boolean keepConnected,
boolean useJSSE)
Initializes the listener by creating the RFCOMM service. |
|
| Method Summary | |
|---|---|
void |
dispose()
Override the dispose method to make sure that we remove the service record from the local SDB. |
java.lang.String |
getRegisteredServiceURL()
After startListening finished successfully, this will return the URL that can be used by RFCOMM clients to connect to this service. |
static void |
main(java.lang.String[] args)
|
void |
run()
This actually implements the listening for new RFCOMM channels. |
void |
start()
Need to override the startListening method to register the SDP service. |
void |
stop()
Need to override the stopListening method to properly close the RFCOMM service notifier. |
| Methods inherited from class org.openuat.util.HostServerBase |
|---|
addProtocolCommandHandler, isRunning, removeProtocolCommandHandler, setProtocolCommandHandler, startProtocol |
| Methods inherited from class org.openuat.authentication.AuthenticationEventSender |
|---|
addAuthenticationProgressHandler, raiseAuthenticationFailureEvent, raiseAuthenticationProgressEvent, raiseAuthenticationStartedEvent, raiseAuthenticationSuccessEvent, removeAuthenticationProgressHandler, setAuthenticationProgressHandlers |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.openuat.util.HostAuthenticationServer |
|---|
addAuthenticationProgressHandler, removeAuthenticationProgressHandler |
| Constructor Detail |
|---|
public BluetoothRFCOMMServer(java.lang.Integer channel,
javax.bluetooth.UUID serviceUUID,
java.lang.String serviceName,
int protocolTimeoutMs,
boolean keepConnected,
boolean useJSSE)
throws java.io.IOException
channel - The RFCOMM channel to use, or unspecified (dynamically
use a free channel) when null.serviceUUID - The Bluetooth service UUID to register.serviceName - The name to announce via SDP.useJSSE - If set to true, the JSSE API with the default JCE provider of the JVM will be used
for cryptographic operations. If set to false, an internal copy of the Bouncycastle
Lightweight API classes will be used.protocolTimeoutMs - The maximum duration in milliseconds that this authentication
protocol may take before it will abort with an AuthenticationFailed
exception. Set to -1 to disable the timeout.
java.io.IOExceptionIf set to true, the connection to the client will be kept connected after the
registered HostProtocolHandler has finished. This allows the socket to be
reused for additional communication after the first authentication
protocol has been completed.| Method Detail |
|---|
public void start()
throws java.io.IOException
start in interface HostAuthenticationServerstart in class HostServerBaseInternalApplicationException
java.io.IOException
public void stop()
throws InternalApplicationException
stop in interface HostAuthenticationServerstop in class HostServerBaseInternalApplicationExceptionpublic java.lang.String getRegisteredServiceURL()
public void run()
public void dispose()
public static void main(java.lang.String[] args)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException,
java.io.IOException,
InternalApplicationException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.io.IOException
InternalApplicationException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||