FileDocCategorySizeDatePackage
BTGOEPNotifier.javaAPI DocphoneME MR2 API (J2ME)4048Wed May 02 18:00:30 BST 2007com.sun.midp.io.j2me.btgoep

BTGOEPNotifier

public class BTGOEPNotifier extends Object implements com.sun.kvem.jsr082.obex.ObexTransportNotifier
Provides underlying stream notifier to shared obex implementation.

Fields Summary
private javax.microedition.io.StreamConnectionNotifier
notifier
Keeps notifier for transport layer
static final DataElement
DE_OBEX_UUID
Keeps OBEX UUID for service record construction.
Constructors Summary
protected BTGOEPNotifier(javax.microedition.io.StreamConnectionNotifier notifier)
Create BTGOEP Notifier

param
notifier notifier for transport layer
exception
IOException if an error occured while service record creation

 

                            
      
          
        this.notifier = notifier;
        try {
            ServiceRecord servRec = LocalDevice.getLocalDevice().
                getRecord(notifier);
            DataElement protocolList = null;
            synchronized (servRec) {
                protocolList = servRec.getAttributeValue(
                            ServiceRecordImpl.PROTOCOL_DESCRIPTOR_LIST);
                DataElement p = new DataElement(DataElement.DATSEQ);
                p.addElement(DE_OBEX_UUID); // obex UUID
                protocolList.addElement(p);
                servRec.setAttributeValue(
                          ServiceRecordImpl.PROTOCOL_DESCRIPTOR_LIST,
                          protocolList);
            }
        }
        catch (BluetoothStateException e) {
            throw new IOException(e.getMessage());
        }
    
Methods Summary
public com.sun.kvem.jsr082.obex.ObexTransportacceptAndOpen()
Accepts client connection to the service this notifier is assigned to.

return
connection to a client just accepted on transport layer.
exception
IOException if an error occured on transport layer.

        return createTransportConnection(
                (StreamConnection)(notifier.acceptAndOpen()));
    
public voidclose()
Closes this notifier on the transport layer

exception
IOException if an error occured on transport layer

        notifier.close();
    
protected BTGOEPConnectioncreateTransportConnection(javax.microedition.io.StreamConnection sock)
Create btgoep transport connection.

param
sock transport connection
return
BTGOEP Connection

        return new BTGOEPConnection(sock);
    
public javax.microedition.io.ConnectiongetUnderlyingConnection()
Get transport connection noifier

return
transport notifier

        return notifier;