|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.avetana.bluetooth.obex.OBEXConnection
public class OBEXConnection
| Field Summary | |
|---|---|
protected static int |
ABORT
|
protected static int |
CLOSE
|
protected static int |
CONNECT
|
protected static int |
DISCONNECT
|
protected static int |
GET
|
protected int |
mtu
|
protected static int |
PUT
|
protected static int |
SESSION
|
protected static int |
SETPATH
|
| Constructor Summary | |
|---|---|
OBEXConnection(StreamConnection con)
|
|
| Method Summary | |
|---|---|
void |
close()
|
HeaderSet |
connect(HeaderSet headers)
Completes an OBEX CONNECT operation. |
HeaderSet |
createHeaderSet()
Creates a javax.obex.HeaderSet object. |
HeaderSet |
delete(HeaderSet headers)
Performs an OBEX DELETE operation. |
HeaderSet |
disconnect(HeaderSet headers)
Completes an OBEX DISCONNECT operation. |
Operation |
get(HeaderSet headers)
Performs an OBEX GET operation. |
Authenticator |
getAuthenticator()
|
long |
getConnectionID()
Retrieves the connection ID that is being used in the present connection. |
int |
getMTU()
|
RemoteDevice |
getRemoteDevice()
|
protected void |
handleAuthResponse(byte[] authResp,
Authenticator authenticator)
|
protected static byte[] |
hsToByteArray(HeaderSet hs)
|
protected static HeaderSetImpl |
parseHeaders(byte[] data,
int offset)
|
Operation |
put(HeaderSet headers)
Performs an OBEX PUT operation. |
byte[] |
receiveCommand()
|
void |
sendCommand(int commId,
byte[] data)
|
void |
setAuthenticator(Authenticator auth)
Sets the Authenticator to use with this connection. |
void |
setConnectionID(long id)
Sets the connection ID header to include in the request packets. |
HeaderSet |
setPath(HeaderSet headers,
boolean backup,
boolean create)
Completes an OBEX SETPATH operation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final int CONNECT
protected static final int DISCONNECT
protected static final int CLOSE
protected static final int PUT
protected static final int GET
protected static final int SETPATH
protected static final int SESSION
protected static final int ABORT
protected int mtu
| Constructor Detail |
|---|
public OBEXConnection(StreamConnection con)
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
public void close()
throws java.io.IOException
java.io.IOException
public RemoteDevice getRemoteDevice()
throws java.io.IOException
java.io.IOExceptionpublic HeaderSet createHeaderSet()
ClientSessionjavax.obex.HeaderSet object. This object
can be used to define header values in a request.
createHeaderSet in interface CommandHandlercreateHeaderSet in interface ClientSessionjavax.obex.HeaderSet objectHeaderSetpublic void setAuthenticator(Authenticator auth)
ClientSessionAuthenticator to use with this connection. The
Authenticator allows an application to respond to
authentication challenge and authentication response headers. If no
Authenticator is set, the
response to an authentication challenge or authentication response
header is implementation dependent.
setAuthenticator in interface ClientSessionauth - the Authenticator to use for this connectionpublic void setConnectionID(long id)
ClientSession
setConnectionID in interface ClientSessionid - the connection ID to usepublic long getConnectionID()
ClientSession
getConnectionID in interface ClientSession
public HeaderSet connect(HeaderSet headers)
throws java.io.IOException
ClientSessionheaders
argument is null, no headers will be sent in the request.
This method will never return null.
This method must be called and a successful response code of
OBEX_HTTP_OK must be received before put(),
get(), setPath(), delete(), or
disconnect() may be called. Similarly, after a successful
call to disconnect(), this method must be called before
calling put(), get(), setPath(),
delete(), or disconnect().
connect in interface ClientSessionheaders - the headers to send in the CONNECT request
java.io.IOException - if an error occurred in the transport layer; if
the client is already in an operation; if this method had already been
called with a successful response code of OBEX_HTTP_OK and
calls to disconnect() have not returned a response code
of OBEX_HTTP_OK; if the
headers defined in headers exceed the max packet length
protected void handleAuthResponse(byte[] authResp,
Authenticator authenticator)
throws java.io.IOException
authResp - authenticator -
java.io.IOException
public HeaderSet disconnect(HeaderSet headers)
throws java.io.IOException
ClientSessionheaders
argument is null, no headers will be sent in the request.
This method will end the session. A new session may be started by
calling connect(). This method will never return
null.
disconnect in interface ClientSessionheaders - the header to send in the DISCONNECT request
java.io.IOException - if an error occurred in the transport layer; if
the client is already in an operation; if an OBEX connection does not
exist because connect() has not been called; if
disconnect() has been called and received a response code
of OBEX_HTTP_OK after the last call to
connect(); if the headers defined in headers
exceed the max packet length
public HeaderSet setPath(HeaderSet headers,
boolean backup,
boolean create)
throws java.io.IOException
ClientSessionnull.
setPath in interface ClientSessionheaders - the headers to include in the SETPATH requestbackup - if true, instructs the server to back up one
directory before moving to the directory specified in name (similar to
cd .. on PCs); if false, apply name to the
current directorycreate - if true, instructs the server to create the
directory if it does not exist; if false, instruct the server
to return an error code if the directory does not exist
java.io.IOException - if an error occurred in the transport layer; if
the client is already in an operation; if an OBEX connection does not
exist because connect() has not been called; if
disconnect() had been called and a response code of
OBEX_HTTP_OK was received; if the headers defined in
headers exceed the max packet length
public HeaderSet delete(HeaderSet headers)
throws java.io.IOException
ClientSessionnull.
delete in interface ClientSessionheaders - the header to send in the DELETE request
java.io.IOException - if an error occurred in the transport layer; if
the client is already in an operation; if an OBEX connection does not
exist because connect() has not been called; if
disconnect() had been called and a response code of
OBEX_HTTP_OK was received; if the headers defined in
headers exceed the max packet length
public Operation get(HeaderSet headers)
throws java.io.IOException
ClientSessionOperation object to
continue with the operation. This method will never return
null.
get in interface ClientSessionheaders - the OBEX headers to send as part of the initial GET
request
java.io.IOException - if an error occurred in the transport layer; if
an OBEX connection does not
exist because connect() has not been called; if
disconnect() had been called and a response code of
OBEX_HTTP_OK was received; if connect() has not
been called; if the client is already in an operation;Operation
public Operation put(HeaderSet headers)
throws java.io.IOException
ClientSessionOperation object to
continue with the PUT operation. This method will never return
null.
put in interface ClientSessionheaders - the OBEX headers to send in the initial PUT request
java.io.IOException - if an error occurred in the transport layer; if
an OBEX connection does not
exist because connect() has not been called; if
disconnect() had been called and a response code of
OBEX_HTTP_OK was received; if connect() has not
been called; if the client is already in an operation;Operation
public void sendCommand(int commId,
byte[] data)
throws java.io.IOException
sendCommand in interface CommandHandlerjava.io.IOException
public byte[] receiveCommand()
throws java.io.IOException
receiveCommand in interface CommandHandlerjava.io.IOException
protected static byte[] hsToByteArray(HeaderSet hs)
throws java.io.IOException
java.io.IOException
protected static HeaderSetImpl parseHeaders(byte[] data,
int offset)
public int getMTU()
getMTU in interface CommandHandlerpublic Authenticator getAuthenticator()
getAuthenticator in interface CommandHandler
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||