com.intel.bluetooth.obex
Class OBEXSessionNotifierImpl

java.lang.Object
  extended by com.intel.bluetooth.obex.OBEXSessionNotifierImpl
All Implemented Interfaces:
BluetoothConnectionNotifierServiceRecordAccess, Connection, SessionNotifier

public class OBEXSessionNotifierImpl
extends Object
implements SessionNotifier, BluetoothConnectionNotifierServiceRecordAccess

SessionNotifier implementation. See Bluetooth Specification Documents for details.

Your application should not use this class directly.


Constructor Summary
OBEXSessionNotifierImpl(StreamConnectionNotifier notifier, OBEXConnectionParams obexConnectionParams)
          Applications should not used this function.
 
Method Summary
 Connection acceptAndOpen(ServerRequestHandler handler)
          Waits for a transport layer connection to be established and specifies the handler to handle the requests from the client.
 Connection acceptAndOpen(ServerRequestHandler handler, Authenticator auth)
          Waits for a transport layer connection to be established and specifies the handler to handle the requests from the client and the Authenticator to use to respond to authentication challenge and authentication response headers.
 void close()
           
 ServiceRecord getServiceRecord()
           
 void updateServiceRecord(boolean acceptAndOpen)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OBEXSessionNotifierImpl

public OBEXSessionNotifierImpl(StreamConnectionNotifier notifier,
                               OBEXConnectionParams obexConnectionParams)
                        throws IOException,
                               Error
Applications should not used this function.

Throws:
Error - if called from outside of BlueCove internal code.
IOException
Method Detail

acceptAndOpen

public Connection acceptAndOpen(ServerRequestHandler handler)
                         throws IOException
Description copied from interface: SessionNotifier
Waits for a transport layer connection to be established and specifies the handler to handle the requests from the client. No authenticator is associated with this connection, therefore, it is implementation dependent as to how an authentication challenge and authentication response header will be received and processed.

Additional Note for OBEX over Bluetooth

If this method is called on a SessionNotifier object that does not have a ServiceRecord in the SDDB, the ServiceRecord for this object will be added to the SDDB. This method requests the BCC to put the local device in connectable mode so that it will respond to connection attempts by clients.

The following checks are done to verify that the service record provided is valid. If any of these checks fail, then a ServiceRegistrationException is thrown.

This method will not ensure that ServiceRecord associated with this notifier is a completely valid service record. It is the responsibility of the application to ensure that the service record follows all of the applicable syntactic and semantic rules for service record correctness.

Note : once an application invokes close() on any SessionNotifier, L2CAPConnectionNotifier, or StreamConnectionNotifer instance, all pending acceptAndOpen() methods that have been invoked previously on that instance MUST throw InterruptedIOException. This mechanism provides an application with the means to cancel any outstanding acceptAndOpen() method calls.

Specified by:
acceptAndOpen in interface SessionNotifier
Parameters:
handler - the request handler that will respond to OBEX requests
Returns:
the connection to the client
Throws:
IOException - if an error occurs in the transport layer

acceptAndOpen

public Connection acceptAndOpen(ServerRequestHandler handler,
                                Authenticator auth)
                         throws IOException
Description copied from interface: SessionNotifier
Waits for a transport layer connection to be established and specifies the handler to handle the requests from the client and the Authenticator to use to respond to authentication challenge and authentication response headers.

Additional Note for OBEX over Bluetooth

If this method is called on a SessionNotifier object that does not have a ServiceRecord in the SDDB, the ServiceRecord for this object will be added to the SDDB. This method requests the BCC to put the local device in connectable mode so that it will respond to connection attempts by clients.

The following checks are done to verify that the service record provided is valid. If any of these checks fail, then a ServiceRegistrationException is thrown.

This method will not ensure that ServiceRecord associated with this notifier is a completely valid service record. It is the responsibility of the application to ensure that the service record follows all of the applicable syntactic and semantic rules for service record correctness.

Note : once an application invokes close() on any SessionNotifier, L2CAPConnectionNotifier, or StreamConnectionNotifer instance, all pending acceptAndOpen() methods that have been invoked previously on that instance MUST throw InterruptedIOException. This mechanism provides an application with the means to cancel any outstanding acceptAndOpen() method calls.

Specified by:
acceptAndOpen in interface SessionNotifier
Parameters:
handler - the request handler that will respond to OBEX requests
auth - the Authenticator to use with this connection; if null then no Authenticator will be used
Returns:
the connection to the client
Throws:
IOException - if an error occurs in the transport layer

close

public void close()
           throws IOException
Specified by:
close in interface Connection
Throws:
IOException

getServiceRecord

public ServiceRecord getServiceRecord()
Specified by:
getServiceRecord in interface BluetoothConnectionNotifierServiceRecordAccess

updateServiceRecord

public void updateServiceRecord(boolean acceptAndOpen)
                         throws ServiceRegistrationException
Specified by:
updateServiceRecord in interface BluetoothConnectionNotifierServiceRecordAccess
Parameters:
acceptAndOpen - wrap validation in ServiceRegistrationException
Throws:
ServiceRegistrationException


JSR-82 Javadocs Apache License, Version 2.0 Copyright © 2001-2008 Motorola, Inc. ALL RIGHTS RESERVED.
BlueCove Javadocs
Apache License, Version 2.0 Copyright © 2004-2008 BlueCove Team.