public final class ClientSession extends ObexSession
mAuthenticator, mChallengeDigest
Constructor and Description |
---|
ClientSession(ObexTransport trans) |
ClientSession(ObexTransport trans,
boolean supportsSrm)
Create a ClientSession
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
HeaderSet |
connect(HeaderSet header) |
HeaderSet |
delete(HeaderSet header) |
HeaderSet |
disconnect(HeaderSet header) |
void |
ensureOpen()
Verifies that the connection is open.
|
Operation |
get(HeaderSet header) |
long |
getConnectionID() |
boolean |
isSrmSupported() |
Operation |
put(HeaderSet header) |
boolean |
sendRequest(int opCode,
byte[] head,
HeaderSet header,
PrivateInputStream privateInput,
boolean srmActive)
Sends a standard request to the client.
|
void |
setAuthenticator(Authenticator auth) |
void |
setConnectionID(long id)
0xCB Connection Id an identifier used for OBEX connection multiplexing
|
HeaderSet |
setPath(HeaderSet header,
boolean backup,
boolean create) |
handleAuthChall, handleAuthResp
public ClientSession(ObexTransport trans) throws IOException
IOException
public ClientSession(ObexTransport trans, boolean supportsSrm) throws IOException
trans
- The transport to use for OBEX transactionssupportsSrm
- True if Single Response Mode should be used e.g. if the
supplied transport is a TCP or l2cap channel.IOException
- if it occurs while opening the transport streams.public HeaderSet connect(HeaderSet header) throws IOException
IOException
public Operation get(HeaderSet header) throws IOException
IOException
public void setConnectionID(long id)
public HeaderSet delete(HeaderSet header) throws IOException
IOException
public HeaderSet disconnect(HeaderSet header) throws IOException
IOException
public long getConnectionID()
public Operation put(HeaderSet header) throws IOException
IOException
public void setAuthenticator(Authenticator auth) throws IOException
IOException
public HeaderSet setPath(HeaderSet header, boolean backup, boolean create) throws IOException
IOException
public void ensureOpen() throws IOException
IOException
- if the connection is closedpublic boolean sendRequest(int opCode, byte[] head, HeaderSet header, PrivateInputStream privateInput, boolean srmActive) throws IOException
opCode
- the type of request to send to the clienthead
- the headers to send to the clientheader
- the header object to update with the responseprivateInput
- the input stream used by the Operation object; null
if this is called on a CONNECT, SETPATH or DISCONNECTtrue
if the operation completed successfully;
false
if an authentication response failed to passIOException
- if an IO error occurspublic void close() throws IOException
IOException
public boolean isSrmSupported()